<?php

/**
 * Project filter form base class.
 *
 * @package    reclamos
 * @subpackage filter
 * @author     Your name here
 */
abstract class BaseFormFilterPropel extends sfFormFilterPropel
{
  public function setup()
  {
    unset($this['updated_at']);
        $this->unsetFields();

    // auto configure widgets
    WidgetFactory::replaceWidgets($this);
    // auto configure validators
    ValidatorFactory::replaceValidators($this);

    $this->removeWithEmptyOption();

    $this->configureWidgets();
    $this->configureValidators();
  }

  public function unsetFields() {}

  public function removeWithEmptyOption()
  {
    foreach ($this->getWidgetSchema()->getFields() as $name => $widget)
    {
      try
      {
        $this->getWidget($name)->setOption("with_empty", false);
      }
      catch (Exception $e) {}
    }
  }

  public function configureWidgets() {}

  public function configureValidators() {}

}
